package sword;

/**
 * @Author: 海琳琦
 * @Date: 2022/5/30 16:05
 * https://leetcode.cn/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/
 */
public class Title11 {

    public int minArray(int[] numbers) {
        int left = 0, right = numbers.length - 1;
        while (left < right) {
            int middle = (left + right) / 2;
            if (numbers[middle] < numbers[right]) {
                right = middle;
            } else if (numbers[middle] > numbers[right]) {
                left = middle + 1;
            }else{
                right--;
            }
        }
        return numbers[left];
    }

    public static void main(String[] args) {

    }
}
